package com.example.thread.demo.reorder;

/**
 * Created by Administrator on 2020/07/14 0014.
 */
public class ReorderExample {

    int a = 0;
    boolean flag = false;

    public void writer() {
        a = 1;
        flag = true;
    }

    public void reader() {
        if (flag) {
            int i = a * a;
            System.out.println("i=" + i);
        }
    }
}
